package com.yao.controller;

import com.yao.entity.User;
import com.yao.service.IUserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author YaoXJ
 * @Date 2023-07-18
 * @Description
 */
@RestController
public class UserController {

    @Resource
    private IUserService iUserService;

    @PostMapping("/query")
    public User queryUser(@RequestBody User user) {
        return iUserService.queryUser(user);
    }

    @PostMapping("/add")
    public Integer addUser(@RequestBody User user) {
        return iUserService.addUser(user);
    }
}
